package net.da.processor;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public abstract class IOAbstractResponse implements IOResponse {

    private String authorizationCode;

    private List<DaError> errors;

    public IOAbstractResponse() {
        super();
        errors = new ArrayList<DaError>();
    }

    public List<DaError> getErrors() {
        return Collections.unmodifiableList(errors);
    }

    public void addError(DaError error) {
        errors.add(error);
    }

    public boolean hasErrors() {
        return !errors.isEmpty();
    }

    public String getAuthorizationCode() {
        return authorizationCode;
    }

    public void setAuthorizationCode(String authorizationCode) {
        this.authorizationCode = authorizationCode;
    }
}
